package com.highbury5.blog.util;

import java.io.PrintWriter;
import java.io.StringWriter;

public class StringUtil {

    /**
     * 打印异常信息
     * @param e
     * @return 异常
     */
    public static String getErrorStack(Throwable e){
        StringWriter buf = new StringWriter();
        PrintWriter pw = new PrintWriter(buf);
        e.printStackTrace(pw);
        pw.close();
        return buf.getBuffer().toString();
    }

}
